
package com.work.db.entity;

import com.work.i18n.Messages;
import com.work.mvc.model.pojo.MonthSummary;

public enum LeaveTypeEnum {
	URLOP_WYPOCZYNKOWY("urlopWypoczynkowy")
	{
		public void incrementMonthLeaveCounter(MonthSummary summary)
		{
			summary.setHolidayLeave(summary.getHolidayLeave() + 1);
		}
	},
	URLOP_NA_ZADANANIE("urlopNaZadanie")
	{
		public void incrementMonthLeaveCounter(MonthSummary summary)
		{
			summary.setOnDemandLeave(summary.getOnDemandLeave() + 1);
		}
	},
	URLOP_OKOLICZNOSCIOWY("urlopOkolicznosciowy")
	{
		public void incrementMonthLeaveCounter(MonthSummary summary)
		{
			summary.setCasualLeave(summary.getCasualLeave() + 1);
		}
	},
	ZWOLNIENIE_LEKARSKIE("zwolnienieLekarskie")
	{
		public void incrementMonthLeaveCounter(MonthSummary summary)
		{
			summary.setSickLeave(summary.getSickLeave() + 1);
		}
	},
	URLOP_ZA_NADGODZINY("urlopZaNadgodziny")
	{
		public void incrementMonthLeaveCounter(MonthSummary summary)
		{
			summary.setOvertimeLeave(summary.getOvertimeLeave() + 1);
		}
	};

	private String value;

	private LeaveTypeEnum(String value)
	{
		this.value = value;
	}

	public String getValue()
	{
		return value;
	}
	
	public String getTitle() {
		return Messages.get(value);
	}

	public abstract void incrementMonthLeaveCounter(MonthSummary summary);
}
